package com.xinyuan.trade.Utils;

import android.content.SharedPreferences;

import com.xinyuan.trade.XYApplication;

/**
 * SharedPreferences配置信息
 * @author daiye
 *
 */
public class Config {

	// 主机地址
	public static String HOST = "http://trade.sturgeon.mopaas.com/index.php?/post/";
	
	// 首页图片
	public static String BACKGROUND = "background";
	
	// 新闻列表
	public static String NEWSBYPAGE = "newsbypage";
	
	// 公司动态
	public static String COMPANYBYPAGE = "companybypage";
	
	// 微信APP_ID
    public static final String WX_APP_ID = "wx0d0a52aecd770a21";
    
    // 腾讯APP_ID
    public static final String Tencent_APP_ID = "1102022034";
    
	// 用户信息
	private static String USER_INFO = "USER_INFO";
	
	// 第一次启动
	private static String FIRST_START = "FIRST_START";
	
	// 教程查看 
	private static String TUTORIAL_START = "TUTORIAL_START";
	
	public static SharedPreferences UserInfoPreferences = XYApplication.getInstance()
			.getSharedPreferences(USER_INFO, 0);

	public static boolean isFirst() {
		return UserInfoPreferences.getBoolean(FIRST_START, true);
	}

	public static void setFirst(boolean isFirst) {
		UserInfoPreferences.edit().putBoolean(FIRST_START, isFirst).commit();
	}

	public static boolean isTutorial() {
		return UserInfoPreferences.getBoolean(TUTORIAL_START, false);
	}

	public static void setTutorial(boolean isTutorial) {
		UserInfoPreferences.edit().putBoolean(TUTORIAL_START, isTutorial).commit();
	}
	
	/**
	 * 清空数据
	 */
	public static void cleanData() {
		UserInfoPreferences.edit().clear();
	}
}
